package handle

import (
	"embed"
	_ "embed"

	"github.com/gofiber/fiber/v2"
)

func NewStatic() Static {
	return Static{}
}

type Static struct {
}

//go:embed static
var static embed.FS

func (r Static) InitRoute(server *fiber.App) {
	server.Static("/static", "/home/debi/IdeaProjects/LearnGo/web/hertzx/route/")
	//server.Get("/static", r.Static())
}

func (r Static) Static() fiber.Handler {
	return func(ctx *fiber.Ctx) error {
		//router.StaticFS("/using_static", &app.FS{Root: dir, AcceptByteRange: true, PathRewrite: app.NewPathSlashesStripper(1)})
		//router.StaticFile("/result", f.Name())
		return nil
	}
}
func (r Static) Index() fiber.Handler {
	return func(ctx *fiber.Ctx) error {
		//router.StaticFS("/using_static", &app.FS{Root: dir, AcceptByteRange: true, PathRewrite: app.NewPathSlashesStripper(1)})
		//router.StaticFile("/result", f.Name())
		return nil
	}
}
